package com.may.wind.enums;

/**
 * 结果枚举
 * 1.是否响应成功
 * 2.响应状态码
 * 3.状态码描述
 * 4.响应数据
 * 5.其他标识符
 */
public enum ResultEnum {
    SUCCESS(true, 200, "成功"),
    UNKNOWN_ERROR(false, 500, "未知错误"),
    PARAM_ERROR(false, 416, "请求范围不符合要求"),
    NULL_POINT(false, 603, "空指针异常"),
    HTTP_CLIENT_ERROR(false, 504, "客户端连接异常");

    /**
     * 响应是否成功
     */
    private Boolean success;
    /**
     * 响应状态码
     */
    private Integer code;
    /**
     * 响应信息
     */
    private String message;

    ResultEnum(boolean success, Integer code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    public Boolean getSuccess() {
        return success;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
